#pragma once

#include <list>
#include <vector>
#include <sstream>
#include <string>
#include <exception>
#include <cassert>

namespace xml {

class node;
class const_node;
class temp_node;
class implementation;
class filter;

typedef unsigned int			size_type;
typedef void *					handle;
typedef std::string				string;
typedef const char *			c_string;
typedef std::list<node>			node_list;
typedef std::list<const_node>	const_node_list;
typedef std::vector<node>		node_vector;
typedef std::vector<const_node>	const_node_vector;

typedef std::list<string>		string_list;
typedef string_list::iterator	string_iterator;

class exception : public std::exception { 
};
// see more in exceptions.h

class filter {
private:
	string	_tag;
public:
	filter() 
		{ }
	filter(const char * tag)
		: _tag(tag) { }
	filter(const string & tag)
		: _tag(tag) { }
public:
	const string & tag() const
		{ return _tag; }
	virtual string describe() const
		{ return string("tag = ") + _tag; }
	virtual bool accept(const const_node & n) const
		{ return true; }
};

///the class is used to specify default value in fuction calls
template <class T>
struct def_t {
	const T & val;
	explicit def_t(const T & v) : val(v) {}
};

template <class T>
inline def_t<T> def(const T & v)
	{ return def_t<T>(v); }

} // xml
